package com.ruoyi.web.controller.wq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.wq.domain.WqCommentReply;
import com.ruoyi.wq.domain.vo.WqCommentReplyVO;
import com.ruoyi.wq.service.IWqCommentReplyService;

/**
 * 评论回复Controller
 * 
 * @author ruoyi
 * @date 2022-03-29
 */
@RestController
@RequestMapping("/wq/reply")
public class WqCommentReplyController extends BaseController
{
    @Autowired
    private IWqCommentReplyService wqCommentReplyService;

    /**
     * 查询评论回复列表
     */
    @GetMapping("/list")
    public TableDataInfo list(WqCommentReplyVO wqCommentReply){
    	TableDataInfo info = wqCommentReplyService.selectWqCommentReplyList(wqCommentReply);
        return info;
    }

    /**
     * 新增评论回复
     */
    @RepeatSubmit
    @PostMapping("/add")
    public AjaxResult add(@RequestBody WqCommentReply wqCommentReply){
        return AjaxResult.success(wqCommentReplyService.insertWqCommentReply(wqCommentReply));
    }

    /**
     * 删除评论回复
     */
	@GetMapping("/delete")
    public AjaxResult delete(String id){
        return toAjax(wqCommentReplyService.deleteById(id));
    }
}
